package com.hkts.naturalgas.utils;

public class ObjectIs {

    public static Object isNull(Object o){
        return (o == null) ? 0 : o;
    }

    public static Object isNullAndO2(Object o){
        if (o == null){
            return 0.0;
        }
        float v = Float.parseFloat(o.toString());
        float max = Float.parseFloat("22");
        if(o !=null && v > max){
            return 20.95;
        }else {
            return o;
        }
    }
    public static Object isNullAndSo2(Object o){
        if (o == null){
            return 0.0;
        }
        float v = Float.parseFloat(o.toString());
        float max = Float.parseFloat("100");
        if(o !=null && v > max){
            return 0.1875;
        }else {
            return o;
        }
    }
    public static Object isNullAndNox(Object o){
        if (o == null){
            return 0.0;
        }
        float v = Float.parseFloat(o.toString());
        float max = Float.parseFloat("50");
        if(o !=null && v > max){
            return 28.305;
        }else {
            return o;
        }
    }
}
